{% extends "base.html" %}
{% load event_tags %}
{% load i18n %}
{% load display_tags %}
{% block content %}
    {{ block.super }}

    <h2> {{ name }}</h2>
    <form class="simple_metrics" action="{% url 'simple_metrics' %}" method="post">{% csrf_token %}
        {{ form.as_p }}
        <input class="btn btn-primary" type="submit" value="{% trans 'Generate Metrics For Selected Month/Year' %}"/>
    </form>
    <hr/>

    {% for key, value in findings.items %}

        <h3 class="inline-block">{{ key.name }}</h3> [
        <a href="{% url 'product_type_metrics' key.id %}" class="inline-block">{% trans "View Details" %}</a>]
        <div class="panel panel-default table-responsive">
            <table class="table table-bordered table-condensed table-striped">
                <thead>
                <tr>
                    <th>{% trans "Total" %}</th>
                    <th>{% trans "Critical" %}</th>
                    <th>{% trans "High" %}</th>
                    <th>{% trans "Medium" %}</th>
                    <th>{% trans "Low" %}</th>
                    <th>{% trans "Info" %}</th>
                    <th>{% trans "Opened This Month" %}</th>
                    <th>{% trans "Closed This Month" %}</th>
                </tr>
                </thead>
                <tbody>
                <tr>
                    <td class="text-right">
                        {{ value.Total }}
                    </td>
                    <td class="text-right">
                        {{ value.S0 }}
                    </td>
                    <td class="text-right">
                        {{ value.S1 }}
                    </td>
                    <td class="text-right">
                        {{ value.S2 }}
                    </td>
                    <td class="text-right">
                        {{ value.S3 }}
                    </td>
                    <td class="text-right">
                        {{ value.S4 }}
                    </td>
                    <td class="text-right">
                        {{ value.Opened }}
                    </td>
                    <td class="text-right">
                        {{ value.Closed }}
                    </td>

                </tr>
                </tbody>
            </table>
        </div>
    {% endfor %}

{% endblock %}